<html> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Dinner</title> 
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/jquery_json.js"></script>
<script type="text/javascript" src="js/collection.js"></script>
<script type="text/javascript" src="js/dinner.js"></script>
<script type="text/javascript" src="js/dinner_biz.js"></script>
</head>
<script>
var globalHandler = new GlobalHandler();
initHandler(globalHandler);
var connection = new Connection("localhost","8001",globalHandler);
function doAdd() {
	var left = $('#add_left').val();
	var right = $('#add_right').val();
	var message = new CSAdd(left,right);
	connection.send(message);
}
function doSub() {
	var left = $('#sub_left').val();
	var right = $('#sub_right').val();
	var message = new CSSub(left,right);
	connection.send(message);
}
function doMul() {
	var left = $('#mul_left').val();
	var right = $('#mul_right').val();
	var message = new CSMul(left,right);
	connection.send(message);
}
function doDiv() {
	var left = $('#div_left').val();
	var right = $('#div_right').val();
	var message = new CSDiv(left,right);
	connection.send(message);
}
</script>
<body>
	<input type="text" id="add_left"/>
	<input type="text" id="add_right"/>
	<input type="text" id="add_result" readonly/>
	<input type="button" id="add_but" value="加" onclick="doAdd();"/>
	<br/>
	<input type="text" id="sub_left"/>
	<input type="text" id="sub_right"/>
	<input type="text" id="sub_result" readonly/>
	<input type="button" id="sub_but" value="减" onclick="doSub();"/>
	<br/>
	<input type="text" id="mul_left"/>
	<input type="text" id="mul_right"/>
	<input type="text" id="mul_result" readonly/>
	<input type="button" id="mul_but" value="乘" onclick="doMul();"/>
	<br/>
	<input type="text" id="div_left"/>
	<input type="text" id="div_right"/>
	<input type="text" id="div_result" readonly/>
	<input type="button" id="div_but" value="除" onclick="doDiv();"/>
	<br/>
</body> 
</html> 